﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPMS.Log.ObjectFormatter
{
    /// <summary>
    /// 对象格式化器注册器接口
    /// </summary>
    /// <remarks>用于维护对象格式化器</remarks>
    /// <history>
    /// [zanezeng]               2010/1/13 13:25    创建
    /// </history>
    public interface IObjectFormatterRegistry : IObjectFormatterProvider
    {
        /// <summary>
        /// 获得或者设置默认的对象格式化器
        /// </summary>
        /// <value>默认的对象格式化器</value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2010/1/13 13:27    创建
        /// </history>
        IObjectFormatter DefaultFormatter
        {
            get;
            set;
        }

        /// <summary>
        /// 清除所注册的对象格式化器
        /// </summary>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2010/1/13 13:27    创建
        /// </history>
        void Clear();

        /// <summary>
        /// 注册给定对象类型的对象格式化器
        /// </summary>
        /// <param name="objectType">要注册的对象格式化器支持的对象类型</param>
        /// <param name="formatter">要注册的对象格式化器</param>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="objectType"/>或者<paramref name="formatter"/>为<c>null</c>引用。</exception>
        /// <history>
        /// [zanezeng]               2010/1/13 13:25    创建
        /// </history>
        void RegisterFormatter( Type objectType, IObjectFormatter formatter );

        /// <summary>
        /// 注销给定对象类型的对象格式化器
        /// </summary>
        /// <param name="objectType">要注销的对象格式化器支持的对象类型</param>
        /// <returns>被注销的对象格式化器。如果给定类型的对象格式化器不存在，则返回空引用。</returns>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="objectType"/>为<c>null</c>引用。</exception>
        /// <history>
        /// [zanezeng]               2010/1/13 14:07    创建
        /// </history>
        IObjectFormatter UnreigsterFormatter( Type objectType );
    }
}
